<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
	<?php
	$username = $_POST["username"];
	$password=$_POST["password"];
	
	 $con = mysqli_connect('localhost','root','');
	
	if(mysqli_errno($con)){
	 echo "link mysql  sb：".mysqli_error($con);
	 exit;
	}

	 mysqli_select_db($con,'my_db');
	 $sql = "select *from Persons  where username='$username' and password='$password'";
	
	 $result = mysqli_query($con,$sql);
	 $num = mysqli_num_rows($result);
	 if($num){
	  
	header ("Refresh:1;url=main.html");

	 }else{
	 echo('用户名或密码错误,请返回上一页重新输入');
	 }
	 mysqli_close($con);
	 ?>
 </body>
 </html>
